package com.starhub.service.impl;

import java.util.List;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.starhub.dao.ProductDao;
import com.starhub.entity.ProductCarousel;
import com.starhub.service.ProductService;

@RestController
public class ProductServiceImpl implements ProductService {

	private ProductDao productDao;
	
	@RequestMapping(value = "getProductCarousel")
	public List<ProductCarousel> getProductCarousels(@RequestParam(value = "categoryId") int categoryId) {
		return productDao.getProductCarousels(categoryId);
	}
	
	@RequestMapping(value = "getProducCarouselDetails")
	public ProductCarousel getProducCarouselDetails(@RequestParam(value = "productId") int productId) {
		return productDao.getProducCarouselDetails(productId);
	}

	@RequestMapping(value = "updateProductCarousel")
	public void updateProductCarousel(@RequestBody ProductCarousel productCarousel) {
		productDao.updateProductCarousel(productCarousel);
		
	}

	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}
}
